<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMemberTaskTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('member_task', function (Blueprint $table) {
            $table->increments('task_id');
            $table->unsignedInteger('member_id')->index()->nullable()->comment('成员ID');
            $table->string('task_name')->default('')->comment('任务名称');
            $table->timestamp('start_time')->nullable()->comment('开始时间');
            $table->timestamp('end_time')->nullable()->comment('结束时间');
            $table->string('project_name')->default('')->comment('项目名称');
            $table->unsignedTinyInteger('priority')->default('3')->comment('优先级：1为紧急，2为高，3为中，4为低');
            $table->mediumText('task_desc')->comment('任务描述');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('member_task');
    }
}
